package cn.zongjie.day06;

import java.util.ArrayList;

public class Test01 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student s1 = new Student("lisi", 21, "男");
        Student s2 = new Student("wangwu", 18, "男");
        Student s3 = new Student("aihua", 22, "女");
        Student s4 = new Student("小明", 23, "男");
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        int max = s1.getAge();
        for (Student s : list) {
            if (s.getAge() > max) {
                max = s.getAge();
            }
        }

    }
}
